Skip to content

Update ConfigConnector CRDs to v1.127.0 #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

sawadakaku
Copy link
Contributor

source crd files: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/v1.127.0/crds

PR Checklist

The extractor script is modified a bit to read local CRD files.

diff --git a/Utilities/crd-extractor.sh b/Utilities/crd-extractor.sh
index 3b6ce3b..4827b10 100755
--- a/Utilities/crd-extractor.sh
+++ b/Utilities/crd-extractor.sh
@@ -2,7 +2,7 @@

 fetch_crd() {
     filename=${1%% *}
-    kubectl get crds "$filename" -o yaml >"$TMP_CRD_DIR/$filename.yaml" 2>&1
+    cp "$CNRM_CRD_DIR/$filename" "$TMP_CRD_DIR/$filename" 2>&1
 }

 # Check if python3 is installed
@@ -48,6 +48,8 @@ if ! echo 'import yaml' | python3 &>/dev/null; then
     done
 fi

+CNRM_CRD_DIR=$(pwd)/../k8s-config-connector/crds
+
 # Create temp folder for CRDs
 TMP_CRD_DIR=$HOME/.datree/crds
 mkdir -p "$TMP_CRD_DIR"
@@ -59,7 +61,7 @@ cd "$SCHEMAS_DIR" || exit 1

 # Get a list of all CRDs
 printf "Fetching list of CRDs...\n"
-IFS=$'\n' read -r -d '' -a CRD_LIST < <(kubectl get crds 2>&1 | sed -n '/NAME/,$p' | tail -n +2 && printf '\0')
+IFS=$'\n' read -r -d '' -a CRD_LIST < <(ls ${CNRM_CRD_DIR} && printf '\0')

 # If no CRDs exist in the cluster, exit
 if [ ${#CRD_LIST[@]} == 0 ]; then

@eyarz eyarz merged commit 2b2aac4 into datreeio:main Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants